1. Field of the Invention
The present invention relates to a method, system, and program for managing locks enabling access to a shared resource.
2. Description of the Related Art
In a network system, a client may access a storage resource including a file system through a server node. The storage resource may comprise one or more hard disk drives, an array of disks (e.g., Just a Bunch of Disks (JBOD), a Redundant Array of Independent Disk RAID), etc.), a tape library or a cache. In the Network File System (NFS), client systems issue requests to an NFS server, which then is capable of accessing data and performing Input/Output (I/O) operations with respect to a shared storage resource. In this way, the NFS server acts as an intermediary to read, write, create or delete files maintained in another system, which may be any computing device in the network. The NFS client mounts the data sets from another system to appear as local directories and files on the client system. The NFS server allows for file sharing between operating system platforms and file serving. An NFS client includes software that enables the client to access data from the NFS server.
An NFS client may lock a record or file on the NFS server. A client may obtain a monitored lock. With a monitored lock, if the host on which the NFS server is operating failed, then the locks are reinstated when the server host recovers. If the client host fails before the locks are released, then the NFS server will discard the locks. Each NFS client and server includes a lock manager program that manages locks and includes the protocol to handle recovery from failure. The lock managers obtain information on the status of locks through a network status monitor (NSM) program that runs on each client and server. Applications use the network status monitor (NSM) to register interest in certain machines. The NSM then notifies the clients/applications on any changed state with respect to monitored machines, such as going offline or online.
For instance, when an NFS client goes down, the lock managers on all servers are notified through their network status monitors (NSM). The server locking managers then release the client's locks, on the assumption that the client will request locks again as needed. When an NFS server crashes, the NFS clients wait for notification from an NSM that the server is back on-line and then take appropriate action to reclaim their locks. Once the server is up, the server lock manager will provide the client lock managers a grace period to submit lock reclaim requests during which the server will accept only reclaim requests.
The above described locking mechanisms are utilized when there is a single NFS server node providing access to a shared storage resource. However, there is a need in the art to provide a locking protocol and mechanism when multiple server nodes provide access to the same shared storage resource.